package com.lhoverc.mapper;

import com.lhoverc.pojo.VO.ComplaintVO;
import com.lhoverc.pojo.dto.ComplaintReplyDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @Author: LiCheng
 * @CreateTime: 2025-05-03
 * @Description:
 * @Version: 1.0
 */
@Mapper
public interface ComplaintMapper {

    /**
     * 查询所有信息
     * @return
     */
    @Select("select * from complaint_advice ca, user u where ca.is_deal = 0 and u.id = ca.user_id order by ca.create_time desc")
    List<ComplaintVO> getComplaintAdvice();

    /**
     * 修改处理
     * @param complaintReplyDto
     */
    @Update("update complaint_advice set reply = #{reply}, is_deal = 1 where id = #{id}")
    void updateIsDeal(ComplaintReplyDto complaintReplyDto);
}
